<Window x:Class="SalesPoint.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="{Binding Path=ApplicationTitle}"
        Height="700"
        Width="1024"
        MinHeight="600"
        WindowStartupLocation="CenterScreen"
        Icon="/SalesPoint;component/Resources/Icon.ico">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/TabControlStyles.xaml" />
                <ResourceDictionary Source="../Resources/ControlPaneStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MaxWidth="200"
                              MinWidth="200"
                              Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <DockPanel Background="#EBEBEB"
                   LastChildFill="False"
                   Grid.Column="0">
            <Grid DockPanel.Dock="Top"
                  Height="500">
                <Grid.Background>
                    <ImageBrush ImageSource="../Resources/ControlPaneBackground.png" />
                </Grid.Background>
                <ItemsControl ItemsSource="{Binding Commands}" Margin="30,24,0,0">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <TextBlock Margin="0,0,0,16">
                        <Hyperlink Command="{Binding Path=Command}"
                                    Style="{StaticResource ResourceKey=CommandLinkStyle}">
                            <TextBlock Text="{Binding Path=DisplayName}" />
                        </Hyperlink>
                    </TextBlock>
                            </Grid>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Grid>
            <Grid DockPanel.Dock="Bottom">
                <TextBlock Margin="30,0,0,24">
                    <Hyperlink Command="{Binding LogoutCommand}"
                               Style="{StaticResource ResourceKey=CommandLinkStyle}">Log out</Hyperlink>
                </TextBlock>
            </Grid>
        </DockPanel>
        <TabControl Grid.Column="1"
                    ItemsSource="{Binding Workspaces}"
                    IsSynchronizedWithCurrentItem="True">
            <TabControl.ItemContainerStyle>
                <Style TargetType="TabItem">
                    <Setter Property="Padding"
                            Value="5" />
                    <Setter Property="Content"
                            Value="{Binding View}" />
                </Style>
            </TabControl.ItemContainerStyle>
            <TabControl.ItemTemplate>
                <DataTemplate>
                    <DockPanel LastChildFill="True">
                        <Button Style="{StaticResource TabItemCloseButtonStyle}"
                                Command="{Binding Path=CloseCommand}"
                                DockPanel.Dock="Right"
                                Margin="10, 0, 0, 0"
                                VerticalAlignment="Top"
                                HorizontalAlignment="Right"></Button>
                        <ContentPresenter Content="{Binding Path=DisplayName}"
                                          VerticalAlignment="Bottom" />
                    </DockPanel>
                </DataTemplate>
            </TabControl.ItemTemplate>
        </TabControl>
    </Grid>
</Window>
